<template>
  <div class="detail">
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="业务信息" name="first">
        <div class="button">
          <el-button @click="goBack">返回</el-button>
        </div>
      </el-tab-pane>
      <el-tab-pane label="审批历史" name="second"> </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
import { getHist } from "@/api/activiti/query";
export default {
  data() {
    return {
      activeName: "second",
      buskey: "",
      approveReason: "",
    };
  },
  created() {
    this.batchId = this.$route.params.batch_id;
    console.log("history:" + this.batchId);
    this.getHistory();
  },
  methods: {
    handleClick(tab, event) {
      console.log(tab, event);
    },
    getHistory() {
      //自定义的方法
      let params = {
        batchId: this.batchId,
      };
      getHist(params).then((res) => {
        console.log(res.data);
      });
    },

    goBack() {
      this.$router.go(-1);
    },
  },
};
</script>

<style scoped>
.detail {
  width: 80%;
  height: 100%;
  margin: 2% auto;
}

.button {
  width: 30%;
  margin: 4% auto;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}
</style>